Optimal. Leaf size=91 \[ -\cosh ^{-1}(x)+\sqrt {\frac {2}{5} \left (-1+\sqrt {5}\right )} \tan ^{-1}\left (\frac {\sqrt {1+x}}{\sqrt {-2+\sqrt {5}} \sqrt {-1+x}}\right )+\sqrt {\frac {2}{5} \left (1+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {\sqrt {1+x}}{\sqrt {2+\sqrt {5}} \sqrt {-1+x}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(191\) vs. \(2(91)=182\).
time = 0.09, antiderivative size = 191, normalized size of antiderivative = 2.10, number of steps
used = 9, number of rules used = 7, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {915, 1005, 223,
212, 1048, 739, 210} \begin {gather*} \frac {\sqrt {\frac {1}{10} \left (\sqrt {5}-1\right )} \sqrt {x-1} \sqrt {x+1} \text {ArcTan}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (\sqrt {5}-1\right )} \sqrt {x^2-1}}\right )}{\sqrt {x^2-1}}-\frac {\sqrt {x-1} \sqrt {x+1} \tanh ^{-1}\left (\frac {x}{\sqrt {x^2-1}}\right )}{\sqrt {x^2-1}}-\frac {\sqrt {\frac {1}{10} \left (1+\sqrt {5}\right )} \sqrt {x-1} \sqrt {x+1} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {x^2-1}}\right )}{\sqrt {x^2-1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 212
Rule 223
Rule 739
Rule 915
Rule 1005
Rule 1048
Rubi steps
\begin {align*} \int \frac {\sqrt {-1+x} \sqrt {1+x}}{1+x-x^2} \, dx &=\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {\sqrt {-1+x^2}}{1+x-x^2} \, dx}{\sqrt {-1+x^2}}\\ &=-\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {1}{\sqrt {-1+x^2}} \, dx}{\sqrt {-1+x^2}}+\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {x}{\left (1+x-x^2\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-1+x^2}}\\ &=-\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}+\frac {\left (\left (5-\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {1}{\left (1-\sqrt {5}-2 x\right ) \sqrt {-1+x^2}} \, dx}{5 \sqrt {-1+x^2}}+\frac {\left (\left (5+\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {1}{\left (1+\sqrt {5}-2 x\right ) \sqrt {-1+x^2}} \, dx}{5 \sqrt {-1+x^2}}\\ &=-\frac {\sqrt {-1+x} \sqrt {1+x} \tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}-\frac {\left (\left (5-\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \text {Subst}\left (\int \frac {1}{-4+\left (1-\sqrt {5}\right )^2-x^2} \, dx,x,\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )}{5 \sqrt {-1+x^2}}-\frac {\left (\left (5+\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \text {Subst}\left (\int \frac {1}{-4+\left (1+\sqrt {5}\right )^2-x^2} \, dx,x,\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )}{5 \sqrt {-1+x^2}}\\ &=\frac {\sqrt {\frac {1}{10} \left (-1+\sqrt {5}\right )} \sqrt {-1+x} \sqrt {1+x} \tan ^{-1}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (-1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}-\frac {\sqrt {-1+x} \sqrt {1+x} \tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}-\frac {\sqrt {\frac {1}{10} \left (1+\sqrt {5}\right )} \sqrt {-1+x} \sqrt {1+x} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.24, size = 102, normalized size = 1.12 \begin {gather*} -\sqrt {\frac {2}{5} \left (-1+\sqrt {5}\right )} \tan ^{-1}\left (\sqrt {-2+\sqrt {5}} \sqrt {\frac {-1+x}{1+x}}\right )-2 \tanh ^{-1}\left (\sqrt {\frac {-1+x}{1+x}}\right )+\sqrt {\frac {2}{5} \left (1+\sqrt {5}\right )} \tanh ^{-1}\left (\sqrt {2+\sqrt {5}} \sqrt {\frac {-1+x}{1+x}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(230\) vs.
\(2(65)=130\).
time = 0.14, size = 231, normalized size = 2.54
method | result | size |
default | \(-\frac {\sqrt {-1+x}\, \sqrt {1+x}\, \sqrt {5}\, \left (\sqrt {2 \sqrt {5}+2}\, \ln \left (x +\sqrt {x^{2}-1}\right ) \sqrt {2 \sqrt {5}-2}\, \sqrt {5}-\sqrt {2 \sqrt {5}+2}\, \arctan \left (\frac {x \sqrt {5}-x +2}{\sqrt {2 \sqrt {5}-2}\, \sqrt {x^{2}-1}}\right ) \sqrt {5}-\arctanh \left (\frac {x \sqrt {5}+x -2}{\sqrt {2 \sqrt {5}+2}\, \sqrt {x^{2}-1}}\right ) \sqrt {2 \sqrt {5}-2}\, \sqrt {5}+\sqrt {2 \sqrt {5}+2}\, \arctan \left (\frac {x \sqrt {5}-x +2}{\sqrt {2 \sqrt {5}-2}\, \sqrt {x^{2}-1}}\right )-\arctanh \left (\frac {x \sqrt {5}+x -2}{\sqrt {2 \sqrt {5}+2}\, \sqrt {x^{2}-1}}\right ) \sqrt {2 \sqrt {5}-2}\right )}{5 \sqrt {x^{2}-1}\, \sqrt {2 \sqrt {5}+2}\, \sqrt {2 \sqrt {5}-2}}\) | \(231\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 214 vs.
\(2 (65) = 130\).
time = 2.80, size = 214, normalized size = 2.35 \begin {gather*} \frac {2}{5} \, \sqrt {5} \sqrt {2 \, \sqrt {5} - 2} \arctan \left (\frac {1}{8} \, \sqrt {-4 \, {\left (2 \, x + \sqrt {5} - 1\right )} \sqrt {x + 1} \sqrt {x - 1} + 8 \, x^{2} + 4 \, \sqrt {5} x - 4 \, x} \sqrt {2 \, \sqrt {5} - 2} {\left (\sqrt {5} + 1\right )} - \frac {1}{4} \, {\left (\sqrt {x + 1} \sqrt {x - 1} {\left (\sqrt {5} + 1\right )} - \sqrt {5} x - x - 2\right )} \sqrt {2 \, \sqrt {5} - 2}\right ) + \frac {1}{10} \, \sqrt {5} \sqrt {2 \, \sqrt {5} + 2} \log \left (2 \, \sqrt {x + 1} \sqrt {x - 1} - 2 \, x + \sqrt {5} + \sqrt {2 \, \sqrt {5} + 2} + 1\right ) - \frac {1}{10} \, \sqrt {5} \sqrt {2 \, \sqrt {5} + 2} \log \left (2 \, \sqrt {x + 1} \sqrt {x - 1} - 2 \, x + \sqrt {5} - \sqrt {2 \, \sqrt {5} + 2} + 1\right ) + \log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int \frac {\sqrt {x - 1} \sqrt {x + 1}}{x^{2} - x - 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.15, size = 16, normalized size = 0.18 \begin {gather*} \log \left ({\left (\sqrt {x + 1} - \sqrt {x - 1}\right )}^{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.02, size = 916, normalized size = 10.07 \begin {gather*} -4\,\mathrm {atanh}\left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )-\frac {\sqrt {10}\,\mathrm {atan}\left (\frac {3408370\,\sqrt {10}\,\sqrt {\sqrt {5}+1}-\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,300730{}\mathrm {i}-3408370\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}-1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}+7836865\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}+3066340\,\sqrt {10}\,x^2\,\sqrt {\sqrt {5}+1}-1294942\,\sqrt {5}\,\sqrt {10}\,x^2\,\sqrt {\sqrt {5}+1}+\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,300730{}\mathrm {i}-\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,134482{}\mathrm {i}+1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}-\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,300730{}\mathrm {i}-6132680\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}-3475583\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}+\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,134482{}\mathrm {i}+\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,150365{}\mathrm {i}-\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,134482{}\mathrm {i}+2589884\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}+\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,67241{}\mathrm {i}}{29119280\,x-24066900\,x\,\sqrt {x+1}-11518800\,\sqrt {5}\,x-10104760\,\sqrt {x+1}-7067880\,\sqrt {5}-3992430\,\sqrt {5}\,x^2+12033450\,x^2+7067880\,\sqrt {5}\,\sqrt {x+1}+7984860\,\sqrt {5}\,x\,\sqrt {x+1}+10104760}\right )\,\sqrt {\sqrt {5}+1}\,1{}\mathrm {i}}{5}-\frac {\sqrt {10}\,\mathrm {atan}\left (\frac {3408370\,\sqrt {10}\,\sqrt {1-\sqrt {5}}+3066340\,\sqrt {10}\,x^2\,\sqrt {1-\sqrt {5}}-\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,300730{}\mathrm {i}-3408370\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}+1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}+7836865\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}+3475583\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}+1294942\,\sqrt {5}\,\sqrt {10}\,x^2\,\sqrt {1-\sqrt {5}}+\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,300730{}\mathrm {i}+\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,134482{}\mathrm {i}-1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}-\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,300730{}\mathrm {i}-6132680\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}-\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,134482{}\mathrm {i}+\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,150365{}\mathrm {i}+\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,134482{}\mathrm {i}-2589884\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}-\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,67241{}\mathrm {i}}{29119280\,x-24066900\,x\,\sqrt {x+1}+11518800\,\sqrt {5}\,x-10104760\,\sqrt {x+1}+7067880\,\sqrt {5}+3992430\,\sqrt {5}\,x^2+12033450\,x^2-7067880\,\sqrt {5}\,\sqrt {x+1}-7984860\,\sqrt {5}\,x\,\sqrt {x+1}+10104760}\right )\,\sqrt {1-\sqrt {5}}\,1{}\mathrm {i}}{5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________